const BASE_URL="https://www.web678.xyz";

const get =(url,data)=>{
  return new Promise((resolve,reject)=>{
    wx.request({
      url:BASE_URL + url, //仅为示例，并非真实的接口地址
      data,
      method:'GET',
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 默认值
      },
      success (res) {
        // console.log(res.data)
        resolve(res.data)
      }
    })
  })
}

const post = (url,data)=>{
  return new Promise((resolve,reject)=>{
    wx.request({
      url:BASE_URL + url, //仅为示例，并非真实的接口地址
      data,
      method:'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 默认值
      },
      success (res) {
        // console.log(res.data)
        resolve(res.data)
      }
    })
  })
 
}

module.exports ={
  get,
  post
}